import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login/login.vue')
  },
  {
    path: '/homepage',
    component: () => import('../views/homepage'),
    children: [
      {
        path: '',
        name: 'Home',
        component: () => import(/* webpackChunkName: "about" */ '../views/Home/home.vue')
      },
      {
        path: 'message',
        name: 'Message',
        component: () => import(/* webpackChunkName: "about" */ '../views/Message/message.vue')
      },
      {
        path: 'monitor',
        name: 'Monitor',
        component: () => import(/* webpackChunkName: "about" */ '../views/Monitor/monitor.vue')
      },
      {
        path: 'store',
        name: 'Store',
        component: () => import(/* webpackChunkName: "about" */ '../views/Store/store.vue')
      },
      {
        path: 'personal',
        name: 'Personal',
        component: () => import(/* webpackChunkName: "about" */ '../views/Personal/personal.vue')
      }
    ]
  },
  {
    path: '/goodDetail',
    name: 'GoodDetail',
    component: () => import('../views/Store/good_detail')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
